﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class CompareSteps : IComparer<ProjectStatusTaskType>
    {
        private bool _IsAdvisor;
        public bool IsAdvisor
        {
            get { return _IsAdvisor; }
            set
            {
                _IsAdvisor = value;
            }
        }
        
        public int Compare( ProjectStatusTaskType x , ProjectStatusTaskType y)
        {
            if (IsAdvisor)
            {
                return x.AdvisorStepId.CompareTo( y.AdvisorStepId );
            }
            else
            {
                return x.SurveyorStepId.CompareTo(y.SurveyorStepId);
            }
        }
    }
}
